// pages/appFail/appFail.js
Page({

    /**
     * 页面的初始数据
     */
    data: {
        failRecords: []
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function (options) {
        let userInfo = wx.getStorageSync('userInfo')
        let userId = userInfo.id
        // console.log(userInfo)
        // let params = {
        //     userId : userId
        // }
        wx.request({
            url: 'https://118.31.170.229:5001/api/ZshRegister/GetRegisterBreaks',
            method: 'get',
            data : {
                userId:userId
            },
            success: (res) => {
                this.setData({
                    failRecords:res.data
                }) 
            }
          })
          
    },

    appDetail(data) {
        console.log(data)
        // console.log(data.target.dataset.stockid.state)
        let state = data.target.dataset.stockid.state
        // let userInfo = wx.getStorageSync('userInfo')
        let registerId = data.target.dataset.stockid.registerId
        let stockId = data.target.dataset.stockid.stockId
        // console.log(state)
        // console.log(userId)
        // console.log(stockId)
        if(state == 0) {
            wx.navigateTo({
            url: '../zshAppResult/zshAppResult?id='+registerId+'&stockId='+stockId,
            })
        }else {
          wx.navigateTo({
            url: '../zshAppResult2/zshAppResult2?id='+registerId+'&stockId='+stockId,
            })
        }
      },

    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady: function () {

    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function () {

    },

    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide: function () {

    },

    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload: function () {

    },

    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh: function () {

    },

    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom: function () {

    },

    /**
     * 用户点击右上角分享
     */
    onShareAppMessage: function () {

    }
})